-
Notifications
You must be signed in to change notification settings - Fork 103
make _create_from_dict more resilient #1929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
make _create_from_dict more resilient #1929
Conversation
…ext[]" and ["text[]"] for datatype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
| config = config.copy() | ||
| properties = [] | ||
| for prop in config["properties"]: | ||
| prop = prop.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can skip the copy
| self, | ||
| config: dict, | ||
| ) -> Union[Collection, Awaitable[CollectionAsync]]: | ||
| # Support both "name" and "class" fields for backward compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it right, this is becasue the TS client provides a different output? Is that correct? If yes, could you update the comment?
| assert config.properties[0].data_type == DataType.TEXT | ||
|
|
||
| # Clean up | ||
| client.collections.delete(collection_name_3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a testcanse for the "name" - you could also parametrice our test to make it more readable, check for example test_replication_config
It now accepts
{"name": "ExampleSchema"}or{"class": "ExampleSchema"}as well as
"dataType": "text[]", or"dataType": ["text[]"]